#!/usr/bin/env python
# -*- coding: UTF-8 -*-

import os
import sys

def Extract_File(filePath,target):
    """"""
    zip_command = r'C:\Progra~1\7-Zip\7z' + " "+"x %s -y -o%s" %(filePath,target)
    print zip_command 
    os.system(zip_command)
Extract_File('D:\\test\\HRTX1.7.900.exe','D:\\test\\')

  
def list_to_str(list):  
    try:  
        return reduce(lambda x, y: "%s\n%s" % (x, y), list)  
    except:  
        return ''  
  
output_str = ''  
for root, dirs, files in os.walk("C:\\Program Files\\Tencent\\QQEIM\\"):  
    for filename in files:          
        if os.path.splitext(filename)[1] == '.exe' or os.path.splitext(filename)[1] == '.dll' : 
            output_str += 'filepath:%s\n' % os.path.join(root,filename) 
            filepath = os.path.join(root,filename) 
            output_str += 'filesize:\n%s\n' % os.path.getsize(filepath)     
            output_str += '****************************************************\n'  
  
file = open('output.txt'.decode('utf-8'),'w')  
file.write(output_str)  
file.close()  